package com.cy.service;

import com.cy.api.RemoteProFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
//contextId 自定义bean的名字；fallbackFactory指定一个类的字节码，程序访问失败时要返回给用户的信息
@FeignClient(name="sca-provider",contextId = "remoteProviderService",fallbackFactory = RemoteProFallbackFactory.class)
public interface RemoteProviderService {
    @GetMapping("/provider/echo/{msg}")
    String echoMessage(@PathVariable("msg") String msg);
}
/**
 *
 * springboot强大的地方
 * 起步依赖，自动配置，监控监控actuator，嵌入式web
 * */